package net.aiion.weave.impl.bytecode;

import java.util.ArrayList;
import java.util.Collection;

import net.aiion.weave.spi.bytecode.BytecodeType;

public class BytecodeTypeImpl implements BytecodeType
{
    private String typeName;
    private String superTypeName;
    private final Collection<String> interfaceNames;
    private final Collection<String> annotationNames;

    public BytecodeTypeImpl() {
        interfaceNames = new ArrayList<>();
        annotationNames = new ArrayList<>();
    }

    @Override
    public void setTypeName(final String aTypeName) {
        typeName = aTypeName;
    }

    @Override
    public String getTypeName() {
        return typeName;
    }

    @Override
    public void setSuperTypeName(final String aSuperTypeName) {
        superTypeName = aSuperTypeName;
    }

    @Override
    public String getSuperTypeName() {
        return superTypeName;
    }

    @Override
    public void addInterfaceName(final String aInterfaceName) {
        interfaceNames.add(aInterfaceName);
    }

    @Override
    public boolean hasInterfaceName(final String aInterfaceName) {
        return interfaceNames.contains(aInterfaceName);
    }

    @Override
    public void removeInterfaceName(final String aInterfaceName) {
        interfaceNames.remove(aInterfaceName);
    }

    @Override
    public Collection<String> getInterfaceNames() {
        return interfaceNames;
    }

    @Override
    public void addAnnotationName(final String aAnnotationName) {
        annotationNames.add(aAnnotationName);
    }

    @Override
    public boolean hasAnnotationName(final String aAnnotationName) {
        return annotationNames.contains(aAnnotationName);
    }

    @Override
    public void removeAnnotationName(final String aAnnotationName) {
        annotationNames.remove(aAnnotationName);
    }

    @Override
    public Collection<String> getAnnotationNames() {
        return annotationNames;
    }
}
